package com.satan.vote.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.satan.vote.serializer.CustomDateTimeDerializer;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@Table("tb_vote_detail")
public class VoteDetail {
    @Id(keyType = KeyType.Auto)
    private Integer id; // 编号
    private Integer voteId; // 投票ID
    private Integer voteItemId; // 投票选项ID
    private String openid; // 投票人openid
    @JsonDeserialize(using = CustomDateTimeDerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime voteDate; // 投票时间
}